home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
newsgroups
/
misc.19971216-19980424
/
000328_news@newsmaster….columbia.edu _Mon Mar 23 17:23:51 1998.msg
< prev
next >
Wrap
Internet Message Format
|
2020-01-01
|
3KB
Return-Path: <news@newsmaster.cc.columbia.edu>
Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.35.30])
by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id RAA21555
for <kermit.misc@watsun.cc.columbia.edu>; Mon, 23 Mar 1998 17:23:50 -0500 (EST)
Received: (from news@localhost)
by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id RAA26524
for kermit.misc@watsun; Mon, 23 Mar 1998 17:23:50 -0500 (EST)
Path: news.columbia.edu!panix!news.panix.com!not-for-mail
From: vilardi@panix.com (Greg Vilardi)
Newsgroups: comp.protocols.kermit.misc
Subject: Help with simple script...
Date: 23 Mar 1998 17:23:18 -0500
Organization: Panix
Lines: 68
Message-ID: <6f6ncm$oku@panix3.panix.com>
NNTP-Posting-Host: panix3.panix.com
Summary: Trying to send a file to a port 1 line at a time.
X-Newsposter: trn 4.0-test55 (26 Feb 97)
Xref: news.columbia.edu comp.protocols.kermit.misc:8526
Hi everyone. I am having a problem writing a simple kermit script to take a
flatfile of command records and spit them out to a remote serial device. The
technical details are as follows: C-Kermit v6.0.192 SCO Unix 3.2v4.2 connected
to a CX DigiBoard. The remote system is on a dedicated line, directly connected
and standard RS232 connectivity is working fine.
I need to have a script that will take each line of a file, and send it out
the serial port. The script will then wait for a response from the port, and
log both the command and the response to another file. If some kind person out
there already has a script that does this or something very similar, could you
please e-mail it to me? Or could someone who knows more about scripting than I
do please tell me what is wrong with the script below? I've spent most of the
weekend with the kermit manuals and have had no luck. I tried the FAQ too.
Suggestions to RTFM greatfully accepted if page numbers are provided. I have
read chapters 17, 18 & 19 3 times already.
Many thanks to anyone who can help me on this one.
-Greg V.
Script starts below:
; Read file $1 one line at a time and send command to paging terminal on port
; $3. Write return messages to $2.
def UPDATE {
local \%c cmd
if < \v(argc) 4 end 1 Usage: UPDATE infile outfile device
;set take error off
set carrier-watch off
OPEN READ \%1
if fail end 1 Can't open \%1 for reading.
open write \%2
if fail end 1 Can't open \%2 for writing.
set line \%3
if fail end 1 Cant open port \%3
set speed 9600
set input silence 2
set input timeout-action proceed
set input echo off
define \%c 0
while true {
read cmd
xif fail {
close write
end 0 Commands processed: \%c.
}
increment \%c
; writeln debug-log \m(cmd) \m(\%c)
output \m(cmd) \13\10
input 10 \10
xif fail {
close read
close write
end 1 Terminal did not respond.
}
writeln file \m(cmd)
writeln file \v(input)
}
}
log debug debug.log
update termrecs termrecs.out /dev/ttya01
close debug
--
Greg Vilardi, Host: Scanner Cinema East E-mail:vilardi@panix.com
USnail: 354 Indian Head Rd|In-Touch Management Systems | Home:(516)864-1310
Commack, NY 11725 |Melville, NY 11747 | Work:(516)752-2701x240
.sig Version 0.50(beta release) I thought, I wrote, I posted.